import 'package:du_application/model/IndexModel.dart';
import 'package:flutter/material.dart';
import '../GoodsCards.dart';
import '../../provide/setting.dart';
import 'package:provide/provide.dart';

class DetailRecommend extends StatelessWidget {
  final List<GoodsList> goodsList;
  const DetailRecommend({Key key,this.goodsList}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Provide<SettingProvide>(
            builder: (context,child, model){
              return Container(
      child: Column(
        children: <Widget>[
       Container(
            margin: EdgeInsets.only(top: 5),
            child: Container(
              padding: EdgeInsets.symmetric(horizontal: 10),
              // margin: EdgeInsets.only(top: 5),
              height: 50,
              color: model.themeColor,
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: <Widget>[
               
                
                  
                  Text("为您推荐",
                   
                      style: TextStyle(color: Colors.grey[600], fontSize: 12)),

                 
                ],
              ),
            ),
          ),
          GridView.builder(
            physics: new NeverScrollableScrollPhysics(),
            shrinkWrap: true,
            gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
                //横轴元素个数
                crossAxisCount: 2,
                //纵轴间距
                mainAxisSpacing: 1.0,
                //横轴间距
                crossAxisSpacing: 1.0,
                //子组件宽高长度比例
                childAspectRatio: 1.0),
            itemBuilder: (context, index){
             return getGoodCard(context,goodsList[index]);
            },
            itemCount: goodsList.length,
          ),
        ],
      ),
    );
   },
   ); 
  }
}
